// (function (doc, win) {
//     var docEl = doc.documentElement,
//     resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
//     recalc = function () {
//     var clientWidth = docEl.clientWidth;
//     if (!clientWidth) return;
//     if(clientWidth>=750){
//     docEl.style.fontSize = '100px';
//     }else{
//     docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
//     }
//     };
//     if (!doc.addEventListener) return;
//     win.addEventListener(resizeEvt, recalc, false);
//     doc.addEventListener('DOMContentLoaded', recalc, false);
//     })(document, window);


    (function(win) {
        var tid;
        function refreshRem() {
            let designSize = 1920; // 设计图尺寸
            let html = document.documentElement;
            let wW = html.clientWidth;// 窗口宽度
            let rem = wW * 100 / designSize; 
            document.documentElement.style.fontSize = rem + 'px';
        }
     
    win.addEventListener('resize', function() {
        clearTimeout(tid);
        tid = setTimeout(refreshRem, 300);
    }, false);
    win.addEventListener('pageshow', function(e) {
        if (e.persisted) {
            clearTimeout(tid);
            tid = setTimeout(refreshRem, 300);
        }
    }, false);

    refreshRem();

})(window);
